/*
 * @Author: LAPTOP-STS5K12N\icey 2237665219@qq.com
 * @Date: 2025-01-26 22:00:39
 * @LastEditors: LAPTOP-STS5K12N\icey 2237665219@qq.com
 * @LastEditTime: 2025-01-28 22:31:37
 * @FilePath: \OLED\csrc\ui_manage.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef _MQ_2_H
#define _MQ_2_H

/*include************************************************ */
#include "main.h"
#include "stdbool.h"
/* Public functions ---------------------------------------------------------*/


/*
    @brief MQ2 结构体
*/
typedef struct __MQ2_t
{
    float gas_concentration;
} MQ2_t;

/*
    @brief 读取 MQ-2 的 ADC 值
*/
uint32_t read_mq2_adc(void);

/*
    @brief 计算气体浓度
*/
float calculate_gas_concentration(uint32_t adc_value);


/*
    @brief 获取 MQ2 结构体
*/
MQ2_t *Get_MQ2_Vars(void);


#endif
